<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>用户登录</title>
</head>
<body>
<h2>用户登录</h2>
<form th:action="@{/user/login}" th:object="${user}" method="post">
    <label>用户名：</label>
    <input type="text" th:field="*{username}" required/><br/><br/>

    <label>密码：</label>
    <input type="password" th:field="*{password}" required/><br/><br/>

    <button type="submit">登录</button>
</form>
<div th:if="${error}" style="color: red;">
    <p th:text="${error}"></p>
</div>
</body>
</html>